<template>
	<view class="i-block">
		<view class="i-block-header" @click="headerClick">
			<text class="i-block-title">{{ props.title||'--' }}</text>
			<view class="i-block-more" v-if="isMore">
				<text class="i-block-more-txt">查看更多</text>
				<icon-xiangyou color="#999" size="28"></icon-xiangyou>
			</view>
		</view>
		<view class="i-block-cont">
			<slot></slot>
		</view>
	</view>
</template>

<script setup lang="ts">
	const props = defineProps({
		title: {
			type: String,
			default: ""
		},
		isMore: {
			type: Boolean,
			default: true
		}
	})
	const emit = defineEmits(["click-more"])
	const headerClick = () => {
		emit('click-more')
	}
</script>

<style lang="less" scoped>
	.i-block {
		&-header {
			display: flex;
			padding: 30rpx 24rpx;

			&:active {
				background: #eee;
			}
		}

		&-title {
			flex: 1;
			font-size: 32rpx;
			font-weight: bold;
			color: #333;
		}

		&-more {
			display: flex;
			align-items: center;
			font-size: 0;

			&-txt {
				font-size: 28rpx;
				font-weight: 500;
				color: #999;
			}
		}
	}
</style>